package br.com.abella.snippets.properties;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import junit.framework.Assert;

import org.junit.Test;

public class PropertiesReader {
	
	/**
	 * Load a properties file in Properties class.
	 * 
	 * @throws IOException
	 */
	@Test
	public void readConfigurationUsingProperties() throws IOException {
		
		Properties properties = new Properties();
		
		InputStream is = PropertiesReader.class.getClassLoader().getResourceAsStream("PropertiesReader.properties");
		
		properties.load(is);
		
		Assert.assertEquals(properties.getProperty("url"), "dadawdad"); //properties loaded
	}	
}
